home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Developers / src / out-of-phase-102-c / OutOfPhase 1.02 Source / OutOfPhase Folder / TrackView.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-23  |  9.2 KB  |  235 lines  |  [TEXT/KAHL]

  1. /* TrackView.h */
  2.  
  3. #ifndef Included_TrackView_h
  4. #define Included_TrackView_h
  5.  
  6. /* TrackView module depends on */
  7. /* MiscInfo.h */
  8. /* Audit */
  9. /* Debug */
  10. /* Definitions */
  11. /* Screen */
  12. /* TrackObject */
  13. /* Memory */
  14. /* FrameObject */
  15. /* Frequency */
  16. /* EditImages */
  17. /* NoteObject */
  18. /* StaffCalibration */
  19. /* TrackDisplayScheduling */
  20. /* Array */
  21. /* EditCommandParameters */
  22. /* Numbers */
  23. /* TieTrackPixel */
  24. /* EventLoop */
  25. /* Scrap */
  26. /* Files */
  27. /* BufferedFileInput */
  28. /* BufferedFileOutput */
  29. /* DataMunging */
  30. /* MainWindowStuff */
  31. /* LoadSaveNoteVectors */
  32. /* Alert */
  33.  
  34. #include "NoteObject.h"
  35. #include "Screen.h"
  36. #include "EventLoop.h"
  37.  
  38. struct TrackViewRec;
  39. typedef struct TrackViewRec TrackViewRec;
  40.  
  41. /* forward declarations */
  42. struct TrackObjectRec;
  43.  
  44. /* create a new track view object */
  45. TrackViewRec*                        NewTrackView(struct TrackObjectRec* TrackObj, WinType* Window,
  46.                                                     OrdType X, OrdType Y, OrdType Width, OrdType Height);
  47.  
  48. /* dispose of the track view object */
  49. void                                        DisposeTrackView(TrackViewRec* View);
  50.  
  51. /* get the left edge of the track view area */
  52. OrdType                                    GetTrackViewXLoc(TrackViewRec* View);
  53.  
  54. /* get the top edge of the track view area */
  55. OrdType                                    GetTrackViewYLoc(TrackViewRec* View);
  56.  
  57. /* get the width of the track view area */
  58. OrdType                                    GetTrackViewWidth(TrackViewRec* View);
  59.  
  60. /* get the height of the track view area */
  61. OrdType                                    GetTrackViewHeight(TrackViewRec* View);
  62.  
  63. /* change the location of the track view area */
  64. void                                        SetTrackViewPosition(TrackViewRec* View, OrdType X, OrdType Y,
  65.                                                     OrdType Width, OrdType Height);
  66.  
  67. /* redraw the track view staff bars.  it assumes clipping rectangle has been */
  68. /* properly set up.  XStart is in window coordinates, not track view area coordinates. */
  69. void                                        TrackViewRedrawStaff(TrackViewRec* View, OrdType XStart,
  70.                                                     OrdType Width);
  71.  
  72. /* redraw the whole track view, but don't mess with the clipping region.  XStart is */
  73. /* is in window coordinates, not local coordinates */
  74. void                                        TrackViewRedrawDontSetClip(TrackViewRec* View, OrdType XStart,
  75.                                                     OrdType Width);
  76.  
  77. /* redraw the entire track view, including properly setting the clipping region. */
  78. void                                        TrackViewRedrawAll(TrackViewRec* View);
  79.  
  80. /* get the number of vertical degrees of freedom, for setting the vertical scroll bar */
  81. long                                        TrackViewGetVerticalDegreesOfFreedom(TrackViewRec* View);
  82.  
  83. /* get the vertical offset for setting vertical scroll bar.  0 is top of score area. */
  84. long                                        TrackViewGetVerticalOffset(TrackViewRec* View);
  85.  
  86. /* change the vertical offset and redraw the track view area */
  87. void                                        TrackViewSetNewVerticalOffset(TrackViewRec* View, long Offset);
  88.  
  89. /* hit test to see if the coordinates are within the track view area */
  90. MyBoolean                                TrackViewHitTest(TrackViewRec* View, OrdType X, OrdType Y);
  91.  
  92. /* update the cursor and optionally draw the vertical (pitch) positioning bar */
  93. void                                        TrackViewUpdateMouseCursor(TrackViewRec* View,
  94.                                                     OrdType X, OrdType Y, MyBoolean DrawFunnyBarThing);
  95.  
  96. /* the track data has been modified, so set some flags */
  97. void                                        TrackViewTrackObjectModified(TrackViewRec* View,
  98.                                                     struct TrackObjectRec* TrackObj, long Index);
  99.  
  100. /* another track has been deleted, so remove it from the background list */
  101. void                                        TrackViewObjectTrackDying(TrackViewRec* View,
  102.                                                     struct TrackObjectRec* TrackObj);
  103.  
  104. /* insert a note at the specified mouse coordinate with the attributes */
  105. void                                        TrackViewAddNote(TrackViewRec* View,
  106.                                                     OrdType X, OrdType Y, unsigned long NoteAttributes);
  107.  
  108. /* add a command at the specified mouse coordinates. */
  109. void                                        TrackViewAddCommand(TrackViewRec* View,
  110.                                                     OrdType X, OrdType Y, NoteCommands CommandOpcode);
  111.  
  112. /* erase the vertical (pitch) positioning bar */
  113. void                                        TrackViewUndrawCursorBar(TrackViewRec* View);
  114.  
  115. /* draw the vertical (pitch) positioning bar.  this assumes that it has been */
  116. /* previously undrawn (i.e. it doesn't erase any existing bars) */
  117. void                                        TrackViewDrawCursorBar(TrackViewRec* View);
  118.  
  119. /* get the horizontal offset from the start of the track, in pixels */
  120. long                                        TrackViewGetHorizontalOffset(TrackViewRec* View);
  121.  
  122. /* get the horizontal extent of the track (in pixels) for setting the scroll bar */
  123. long                                        TrackViewGetHorizontalDegreesOfFreedom(TrackViewRec* View);
  124.  
  125. /* change the horizontal position of the track display and redraw */
  126. void                                        TrackViewSetNewHorizontalOffset(TrackViewRec* View, long Offset);
  127.  
  128. /* try to select a single note, if there is one, at the specified mouse location */
  129. void                                        TrackViewTrySingleNoteSelection(TrackViewRec* View,
  130.                                                     OrdType X, OrdType Y);
  131.  
  132. /* is the current selection a single note? */
  133. MyBoolean                                TrackViewIsASingleNoteSelected(TrackViewRec* View);
  134.  
  135. /* is the current selection a single command? */
  136. MyBoolean                                TrackViewIsASingleCommandSelected(TrackViewRec* View);
  137.  
  138. /* is a range of frames selected? */
  139. MyBoolean                                TrackViewIsARangeSelected(TrackViewRec* View);
  140.  
  141. /* is nothing selected, and thus there is an insertion point? */
  142. MyBoolean                                TrackViewIsThereInsertionPoint(TrackViewRec* View);
  143.  
  144. /* get the frame index of the insertion point.  it is an error if there is no */
  145. /* valid insertion point */
  146. long                                        TrackViewGetInsertionPointIndex(TrackViewRec* View);
  147.  
  148. /* get the beginning of a selection range.  it is an error if a range is not selected */
  149. long                                        TrackViewGetRangeStart(TrackViewRec* View);
  150.  
  151. /* get the frame after the end of a selection range.  it is an error if there is */
  152. /* no selected range. */
  153. long                                        TrackViewGetRangeEndPlusOne(TrackViewRec* View);
  154.  
  155. /* get the frame number of a single note or command selection */
  156. long                                        TrackViewGetSingleNoteSelectionFrameNumber(TrackViewRec* View);
  157.  
  158. /* delete the selected single note or command.  it is an error if no single note */
  159. /* or command is selected */
  160. void                                        TrackViewDeleteSingleNoteOrCommand(TrackViewRec* View);
  161.  
  162. /* add a track to the greyed-out background display */
  163. MyBoolean                                TrackViewAddBackgroundTrack(TrackViewRec* View,
  164.                                                     struct TrackObjectRec* TrackObj);
  165.  
  166. /* remove a track from the greyed-out background display */
  167. void                                        TrackViewRemoveBackgroundTrack(TrackViewRec* View,
  168.                                                     struct TrackObjectRec* TrackObj);
  169.  
  170. /* present a dialog box for editing the selected object's attributes.  it is an */
  171. /* error if there is no single note or command selected. */
  172. void                                        TrackViewEditSingleSelectionAttributes(TrackViewRec* View);
  173.  
  174. /* set a tie from the currently selected note to the note at the specified position. */
  175. /* it is an error if there is no single note selected. */
  176. void                                        TrackViewSetTieOnNote(TrackViewRec* View, OrdType X, OrdType Y);
  177.  
  178. /* select a range of frames. */
  179. void                                        TrackViewSetRangeSelection(TrackViewRec* View, long StartFrame,
  180.                                                     long EndFramePlusOne);
  181.  
  182. /* set an insertion point at the specified frame index */
  183. void                                        TrackViewSetInsertionPoint(TrackViewRec* View, long FrameIndex);
  184.  
  185. /* do a mouse down, which may select things.  ExtendSelection is true for shift-key */
  186. /* type selection extending */
  187. void                                        TrackViewDoMouseDown(TrackViewRec* View, OrdType XLoc,
  188.                                                     OrdType YLoc, MyBoolean ExtendSelection,
  189.                                                     void (*ScrollCallback)(void* Refcon), void* Refcon);
  190.  
  191. /* set the range selection to the entire track */
  192. void                                        TrackViewSelectAll(TrackViewRec* View);
  193.  
  194. /* delete the selected range.  it is an error if there is no selected range. it */
  195. /* returns False if it fails.  undo information is automatically maintained */
  196. MyBoolean                                TrackViewDeleteRangeSelection(TrackViewRec* View);
  197.  
  198. /* attempt to paste notes into the track.  returns False if it fails.  undo */
  199. /* information is automatically maintained. */
  200. MyBoolean                                TrackViewAttemptPaste(TrackViewRec* View);
  201.  
  202. /* copy the selected range to the clipboard.  it is an error if there is no selected */
  203. /* range.  it returns True if successful. */
  204. MyBoolean                                TrackViewCopyRangeSelection(TrackViewRec* View);
  205.  
  206. /* cut the range selection (copy to clipboard, then delete).  returns True if */
  207. /* successful.  it is an error if there is no range selected.  automatically */
  208. /* updates undo information. */
  209. MyBoolean                                TrackViewCutRangeSelection(TrackViewRec* View);
  210.  
  211. /* show the selection or insertion point by scrolling the view area */
  212. void                                        TrackViewShowSelection(TrackViewRec* View);
  213.  
  214. /* find out if we can undo the last operation */
  215. MyBoolean                                TrackViewCanWeUndo(TrackViewRec* View);
  216.  
  217. /* dispose of all undo information. */
  218. void                                        TrackViewFlushUndoInfo(TrackViewRec* View);
  219.  
  220. /* save the undo information for the track.  returns False if it fails. */
  221. MyBoolean                                TrackViewBuildFullUndoBackingStore(TrackViewRec* View);
  222.  
  223. /* undo the last operation.  if it fails, well... */
  224. void                                        TrackViewUndo(TrackViewRec* View);
  225.  
  226. /* transpose the selection by adding AddHalfSteps to the pitch of each selected note */
  227. /* AddHalfSteps can be negative.  it is an error if there is no single note selection */
  228. /* or no range selection */
  229. void                                        TrackViewTransposeSelection(TrackViewRec* View, long AddHalfSteps);
  230.  
  231. /* scroll to the specified measure.  invalid measure numbers may be specified. */
  232. void                                        TrackViewShowMeasure(TrackViewRec* View, long MeasureNumber);
  233.  
  234. #endif
  235.